SEPRO.admin.managePaymentType = {
	
	init: function(){
		this.add_button_event();
		this.add_event_for_payment_op();
	},
	
	add_event_for_payment_op: function(){
		$(".add-product-add").click(function(event){
			
			var index = $(".add-product-edit").index($(this)[0]);
			
			var name = $(".static-name").eq(index).html();
			var logoPath = $(".static-logoPath").eq(index).html(); 
			var desp = $(".static-desp").eq(index).html();
			var bargainorIdName = $(".static-bargainorIdName").eq(index).html();
			var bargainorKeyName = $(".static-bargainorKeyName").eq(index).html();
			
			var json_data = {"name": name, "logoPath": logoPath, "desp": desp, "bargainorIdName": bargainorIdName, "bargainorKeyName": bargainorKeyName};
			
			$.ajax({
				url: "../admin/paymentType!addPayment.action",
				dataType: "json",
				data: json_data,
				method: "post",
				cache: false,
				success: function(data){
					if(data.status == "success"){
						alert("success!");
						
					}else if(data.status == "error"){
						alert(data.message);
					}
				}
			});
			
		});
	},
	
	add_button_event: function(){
		$(".btn-add-payment-product").click(function(event){
			event.preventDefault();
			$(".payment-list-added").hide();
			$(".payment-list-add-new").show();
			//SEPRO.admin.managePaymentType.list_add_payment_type();
		});
		$(".btn-list-added-payment-product").click(function(event){
			event.preventDefault();
			$(".payment-list-add-new").hide();
			$(".payment-list-added").show();
		});
	},
};